<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>
<head>

  <meta http-equiv="Content-Language" content="en-us">


  <title>IupFlatLabel</title>
  <link rel="stylesheet" type="text/css" href="../../style.css">

  <style type="text/css">
.style1 {
	margin-left: 40px;
}
  .auto-style1 {
	  font-size: large;
  }
  </style>
</head>


<body>

<div id="navigation">
  
<ul>

    <li><a href="#Creation">Creation</a></li>

    <li><a href="#Attributes">Attributes</a></li>

    <li><a href="#Callbacks">Callbacks</a></li>

    <li><a href="#Notes">Notes</a></li>

    <li><a href="#Examples">Examples</a></li>

    <li><a href="#SeeAlso">See Also</a></li>

  
</ul>

</div>


<h2>IupFlatLabel <span class="auto-style1">(since 3.25)</span></h2>


  
<p>
Creates an interface element that is a label, but it does not have native 
decorations. Its visual presentation can contain a text and/or an image.</p>
<p>It behaves just like an<span class="Apple-converted-space">&nbsp;</span><a href="iuplabel.html">IupLabel</a>, 
but since it is not a native control it has more flexibility for additional 
options.</p>
<p>It inherits from
  <a href="../elem/iupcanvas.html">IupCanvas</a>.</p>


<h3><a name="Creation">Creation</a></h3>


<pre>Ihandle* IupFlatLabel(const char *<strong>title</strong>); [in C]<br>iup.flatlabel{[title = <strong>title</strong>: string]} -&gt; <strong>ih</strong>: ihandle [in Lua]<br>flatlabel(<strong>title</strong>) [in LED]</pre>

  
<p><b>
  title</b>: Text to be shown to the user. It can be NULL. It will set the TITLE 
  attribute.</p>

  
<p>
  <u>Returns:</u> the identifier of the 
  created element, or NULL if an error occurs.</p>


<h3><a name="Attributes">Attributes</a></h3>



<p>Inherits all attributes and callbacks of the <a href="../elem/iupcanvas.html">IupCanvas</a>, 
but redefines a few attributes.</p>
<p><b>ALIGNMENT</b> (<font size="3">non inheritable</font>): horizontal and 
vertical alignment of the set image+text. Possible values: &quot;ALEFT&quot;, &quot;ACENTER&quot; and &quot;ARIGHT&quot;,&nbsp; 
combined to &quot;ATOP&quot;, &quot;ACENTER&quot; and &quot;ABOTTOM&quot;. Default: &quot;ALEFT:ACENTER&quot;. Partial 
values are also accepted, like &quot;ARIGHT&quot; or &quot;:ATOP&quot;, the other value will be 
obtained from the default value. Alignment does not includes the padding area. </p>


  <p><strong>BACKIMAGE</strong> (<font SIZE="3">non inheritable</font>):
  image name to be used as background. Use
	<a href="../func/iupsethandle.html">IupSetHandle</a> or
	<a href="../func/iupsetattributehandle.html">IupSetAttributeHandle</a> to 
	associate an image to a name. See also
	<a href="../elem/iupimage.html">IupImage</a>. </p>
<p><strong>BACKIMAGEZOOM</strong> (<font size="3">non inheritable</font>): 
if set the back image will be zoomed to occupy the full background. Aspect ratio 
is NOT preserved. Can be 
Yes or No. Default: No. (since 3.25)</p>

  
<p><b>BORDER </b>(creation only):
  
  the default value is "NO". This is the <strong>IupCanvas</strong> border.</p>
<p><a href="../attrib/iup_bgcolor.html">BGCOLOR</a>: ignored. It will use the background color of the native parent.</p>
<p>
<a href="../attrib/iup_expand.html" style="font-family: tahoma, verdana, arial, helvetica, geneva, sans-serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 20.7999992370605px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">
EXPAND</a><span style="color: rgb(0, 0, 0); font-family: tahoma, verdana, arial, helvetica, geneva, sans-serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 20.7999992370605px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255);"><span class="Apple-converted-space">&nbsp;</span>(</span><font size="3" style="color: rgb(0, 0, 0); font-family: tahoma, verdana, arial, helvetica, geneva, sans-serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 20.7999992370605px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">non 
inheritable</font><span style="color: rgb(0, 0, 0); font-family: tahoma, verdana, arial, helvetica, geneva, sans-serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 20.7999992370605px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255);">): 
The default value is &quot;NO&quot;.<span class="Apple-converted-space">&nbsp;</span></span></p>

  
<p><a href="../attrib/iup_fgcolor.html">FGCOLOR</a>: Text color. Default: the 
global attribute DLGFGCOLOR.</p>



  
<p><strong>FITTOBACKIMAGE</strong> (<font size="3">non inheritable</font>): 
enable the natural size to be computed from the BACKIMAGE. If BACKIMAGE is not 
defined will be ignored. Can be 
Yes or No. Default: No.</p>


  <p><strong>FRONTIMAGE</strong> (<font SIZE="3">non inheritable</font>):
  image name to be used as foreground. The foreground image is drawn in the same 
  position as the 
  background, but it is drawn at last. Use
	<a href="../func/iupsethandle.html">IupSetHandle</a> or
	<a href="../func/iupsetattributehandle.html">IupSetAttributeHandle</a> to 
	associate an image to a name. See also
	<a href="../elem/iupimage.html">IupImage</a>.</p>
<p><strong>IMAGE</strong> (<font SIZE="3">non inheritable</font>):
  Image name. Use
	<a href="../func/iupsethandle.html">IupSetHandle</a> or
	<a href="../func/iupsetattributehandle.html">IupSetAttributeHandle</a> to 
	associate an image to a name. See also
	<a href="../elem/iupimage.html">IupImage</a>.</p>
  <p><strong>IMAGEINACTIVE</strong> (<font SIZE="3">non inheritable</font>): 
  Image name of the element when inactive. If it is not defined then the IMAGE 
  is used and its colors will be replaced by a modified version creating the 
  disabled effect. </p>

  
<p><strong>IMAGEPOSITION </strong>(<font size="3">non inheritable</font>): 
Position of the image relative to the text when both are displayed. Can be: 
LEFT, RIGHT, TOP, BOTTOM. Default: LEFT.</p>

  
<p><b>PADDING</b>: internal margin. Works just like the MARGIN attribute of 
  the <strong>IupHbox</strong> and <strong>IupVbox</strong> containers, but uses 
a different name to avoid inheritance problems. Default value: &quot;0x0&quot;. 
Alignment does not includes the padding area. </p>


<p><strong>CPADDING</strong>: same as PADDING but using the units of the <strong>
	SIZE</strong> attribute. It will actually set the PADDING attribute. (since 
3.29)</p>


<p><strong>SPACING </strong>(<font SIZE="3">non inheritable</font>): spacing between the 
image and the text. Default: &quot;2&quot;.</p>

  
  <p><strong>CSPACING</strong>: same as SPACING but using the units of the 
  vertical part of the <strong>
	SIZE</strong> attribute. It will actually set the SPACING attribute. (since 
  3.29)</p>

  
  <p><a href="../attrib/iup_title.html">TITLE</a> (<font SIZE="3">non inheritable</font>): 
	Label's text. The '\n' character is accepted for line change.</p>
<p><strong>TEXTALIGNMENT </strong>(<font size="3">non inheritable</font>): 
Horizontal text alignment for multiple lines. Can be: ALEFT, ARIGHT or ACENTER. 
Default: ALEFT. (since 3.22)</p>
<p><strong>TEXTWRAP </strong>(<font size="3">non inheritable</font>): For single 
line texts if the text is larger than its box the line will be automatically 
broken in multiple lines. Notice that this is done internally by the system, the 
element natural size will still use only a single line. For the remaining lines 
to be visible the element should use EXPAND=VERTICAL or set a SIZE/RASTERSIZE 
with enough height for the wrapped lines. (since 3.25)</p>
<p><strong>TEXTELLIPSIS </strong>(<font size="3">non inheritable</font>): 
If the text is larger that its box, an ellipsis (&quot;...&quot;) will be placed near the 
last visible part of the text and replace the invisible part. It will be ignored 
when TEXTWRAP=Yes. (since 3.25)</p>
<p>
<span style="color: rgb(0, 0, 0); font-family: tahoma, verdana, arial, helvetica, geneva, sans-serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 20.8px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255);">
<span class="Apple-converted-space">
<strong>TEXTORIENTATION</strong> (<font size="3">non inheritable</font>): text 
angle in degrees and counterclockwise. The text size will adapt to include the 
rotated space. (since 3.25)</span></span></p>



  
<blockquote>
    
  <hr>
</blockquote>

<p>
<a href="../attrib/iup_active.html">ACTIVE</a>,
<a href="../attrib/iup_font.html">FONT</a>, 
    <a href="../attrib/iup_expand.html">EXPAND</a>, <a href="../attrib/iup_screenposition.html">SCREENPOSITION</a>, 
<a href="../attrib/iup_position.html">
POSITION</a>, <a href="../attrib/iup_minsize.html">
MINSIZE</a>, <a href="../attrib/iup_maxsize.html">
MAXSIZE</a>,
    <a href="../attrib/iup_wid.html">WID</a>, <a href="../attrib/iup_tip.html">TIP</a>, <a href="../attrib/iup_size.html">SIZE</a>, 
<a href="../attrib/iup_rastersize.html">RASTERSIZE</a>,
    <a href="../attrib/iup_zorder.html">ZORDER</a>, <a href="../attrib/iup_visible.html">VISIBLE</a>,
<a href="../attrib/iup_theme.html">THEME</a>: 
also accepted.</p>


<h3><a name="Notes">Notes</a></h3>


<p>The <strong>IupFlatLabel</strong> can contain text and image simultaneously. 
</p>
<p>The natural size will be a combination of the size of the image and the 
title, if any, plus PADDING and SPACING (if both image and title are present).</p>
<p>The <strong>IupLabel</strong> SEPARATOR attribute to configure a separator 
(horizontal or vertical lines) is not supported. ELLIPSIS, MARKUP and WORDWRAP
<strong>IupLabel</strong> attributes are also not supported. Mnemonics are not 
supported.</p>
<h3><a name="Examples">Examples</a></h3>

<p><a href="../../examples/">Browse for Example Files</a></p>

<div align="center">
  <center>
  <table border="0" cellpadding="3" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111">
    <tr>
      <td height="20" align="right" class="style1">Normal Text Label -</td>
      <td rowspan="5" align="center" bordercolor="#FFFFFF" class="style1">
      <img border="0" src="images/iupflatlabel.png"></td>
      <td height="20" align="left" class="style1">- Normal Image Label</td>
    </tr>
    <tr>
      <td height="10" align="right" class="style1">&nbsp;</td>
      <td height="10" align="left" class="style1">&nbsp;</td>
    </tr>
    <tr>
      <td height="52" align="right" class="style1">FGCOLOR = &quot;0 0 255&quot;<br>
      ALIGNMENT=&quot;ALEFT:ATOP&quot;</td>
      <td height="52" align="left" class="style1">&nbsp;ALIGNMENT = &quot;ALEFT&quot;<br>
	  (8bpp Image)</td>
    </tr>
    <tr>
      <td height="51" align="right" class="style1">FONT = &quot;Helvetica, 14&quot;<br>
      		ALIGNMENT = &quot;ACENTER:ACENTER&quot;<br>TEXTALIGNMENT = &quot;ACENTER&quot;</td>
      <td height="51" align="left" class="style1">ALIGNMENT = &quot;ACENTER&quot;<br>
&nbsp; (24 bpp Image)</td>
    </tr>
    <tr>
      <td height="51" align="right" class="style1">ALIGNMENT = &quot;ARIGHT:ABOTTOM&quot;</td>
      <td height="51" align="left" class="style1">&nbsp;ALIGNMENT = &quot;ARIGHT&quot;<br>
&nbsp; (32 bpp Image)</td>
    </tr>
  </table>
  </center>
</div>

<h3><a name="SeeAlso">See Also</a></h3>


<p><a href="iupimage.html">IupImage</a>, <a href="iupbutton.html">IupButton</a>, <a href="iuptoggle.html">IupToggle</a>,
<a href="iuplabel.html">IupLabel</a></p>



</body>
</html>
